<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'loginManager.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script type="text/javascript"
	src="/OAProject/admin_cg/system/dateCalendar/WdatePicker.js"></script>
<link rel="stylesheet" type="text/css" href="/OAProject/admin_cg/system/css/loginlog.css">

</head>

<body>
	<!--备注：
		1. 可以删除选中的日志
		2. 日志从数据库中获取   -->
	<div id="all">
		<div id="header">>>当前位置：登录日志</div>
		<div id="content">
				<form id="loginlogform" action="/OAProject/bt/loginlog_delete"  enctype="multipart/form-data">
					<div id="div-quanxuan">
						<input type="checkbox" id="checkAll" name="checkAll"
							onchange="quanxuan();" />全选
					</div>
					<div id="div-delete">
						<input type="submit" value="删除选定项" />
					</div><br />
					<div id="form-show">
						<table id="all-table" border="1" cellspacing="0" cellpadding="5">
						<tr>
							<th>选定(√)</th>
							<th>序号</th>
							<th>用户名</th>
							<th>IP</th>
							<th>时间</th>
							<th>是否成功</th>
						</tr>
						<s:iterator value="%{loginloglist}">
							<tr>
								<td><input type="checkbox" name="logvalue"  onclick="xuan();"  value=<s:property value="%{loginid}"/>  /></td>
								<td><s:property value="%{loginid}" /></td>
								<td><s:property value="%{userinfo.username}" /></td>
								<td><s:property value="%{loginuserip}" /></td>
								<td><s:property value="%{logintime}" /></td>
								<td><s:if test="%{ifsuccess==1}">是</s:if><s:else>否</s:else></td>
							</tr>
						</s:iterator>
					</table>
					</div>
					
				</form>
				<p style="margin-left: 100px;">	总共<s:property value="pageBean.totalPage" />页，当前【<s:property value="pageBean.currentPage" />/<s:property value="pageBean.totalPage" />】页，
							<s:a href="/OAProject/bt/loginlog_getAll?currentPage=%{1}" >首页</s:a>
							<s:a href="/OAProject/bt/loginlog_getAll?currentPage=%{pageBean.currentPage-1}" >上一页</s:a>
							<s:a href="/OAProject/bt/loginlog_getAll?currentPage=%{pageBean.currentPage+1}"  >下一页</s:a>
							<s:a href="/OAProject/bt/loginlog_getAll?currentPage=%{pageBean.totalPage}" >末页</s:a></p>
			</div>
		</div>
	<script type="text/javascript">
		//全选  和  取消 全选
		function wode(){
			var msg=document.getElementById("wo").value;
			alert(msg);
		}
		function quanxuan() {
			var checkAll = document.getElementById("checkAll");
			var logvalue = document.getElementsByName("logvalue");
			if (checkAll.checked == true) {
				for (var i = 0; i < logvalue.length; i++) {
					logvalue[i].checked = true;
				}
			} else {
				for (var i = 0; i < logvalue.length; i++) {
					logvalue[i].checked = false;
				}
			}
		}
		function xuan() {
			var checkAll = document.getElementById("checkAll");
			var logvalue = document.getElementsByName("logvalue");
			var flag = false;
			for (var i = 0; i < logvalue.length; i++) {
				if (logvalue[i].checked == false) {
					checkAll.checked = false;
					flag = true;
				}
				if (!flag) {
					checkAll.checked = true;
				}
			}
		}
	</script>
	
</body>
</html>
